/* Hexo 风格个人博客系统样式文件 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 14px;
}

/* 代码字体 */
code, pre {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 - Hexo 风格 */
.header {
    background: #fff;
    border-bottom: 1px solid #e1e8ed;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #3498db;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: #7f8c8d;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: #2c3e50;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* 主要内容区域 - Hexo 布局 */
.main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 文章列表 - Hexo 卡片风格 */
.post-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.post-item {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.post-item:hover {
    background-color: #fafafa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-item:last-child {
    border-bottom: none;
}

.post-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #3498db;
}

.post-meta {
    color: #95a5a6;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-meta .meta-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.post-excerpt {
    color: #7f8c8d;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 15px;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tag {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e1e8ed;
}

.tag:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
    transform: translateY(-1px);
}

.post-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 5px;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #ecf0f1;
    color: #7f8c8d;
    border: 1px solid #e1e8ed;
}

.btn-secondary:hover {
    background: #d5dbdb;
    color: #2c3e50;
}

/* 侧边栏 - Hexo 风格 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    border: 1px solid #e1e8ed;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    position: relative;
    padding-bottom: 10px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #3498db;
}

/* 搜索框 */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form .form-control {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-form .form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-form .btn {
    padding: 10px 20px;
    white-space: nowrap;
}

/* 分类和标签列表 */
.category-list, .tag-list {
    list-style: none;
}

.category-list li, .tag-list li {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.category-list li:last-child, .tag-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.category-list a, .tag-list a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.category-list a:hover, .tag-list a:hover {
    color: #3498db;
}

.category-count, .tag-count {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .tag {
    font-size: 12px;
    padding: 6px 12px;
    margin: 2px;
}

/* 热门文章 */
.popular-posts {
    list-style: none;
}

.popular-posts li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.popular-posts li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-posts a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 5px;
}

.popular-posts a:hover {
    color: #3498db;
}

.view-count {
    color: #95a5a6;
    font-size: 12px;
}

/* 分页 - Hexo 风格 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    padding: 20px;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid #e1e8ed;
    color: #7f8c8d;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
    transform: translateY(-1px);
}

.pagination .current {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination .disabled {
    color: #bdc3c7;
    background: #f8f9fa;
    border-color: #e9ecef;
    cursor: not-allowed;
}

/* 文章详情页 */
.post-detail {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid #e1e8ed;
}

.post-header {
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.post-detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #2c3e50;
    line-height: 1.3;
}

.post-detail-meta {
    color: #95a5a6;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.post-content {
    line-height: 1.8;
    color: #2c3e50;
    font-size: 16px;
}

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    margin: 30px 0 15px 0;
    color: #2c3e50;
    font-weight: 600;
}

.post-content h1 { font-size: 28px; }
.post-content h2 { font-size: 24px; }
.post-content h3 { font-size: 20px; }
.post-content h4 { font-size: 18px; }
.post-content h5 { font-size: 16px; }
.post-content h6 { font-size: 14px; }

.post-content p {
    margin-bottom: 20px;
}

.post-content blockquote {
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin: 20px 0;
    background: #f8f9fa;
    color: #7f8c8d;
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

.post-content code {
    background: #f1f2f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 13px;
    color: #e74c3c;
}

.post-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content ul, .post-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-content th, .post-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.post-content th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

/* 评论区域 */
.comments {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
    margin-top: 30px;
    border: 1px solid #e1e8ed;
}

.comments h3 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.comment {
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment-meta {
    color: #95a5a6;
    font-size: 13px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.comment-content {
    color: #2c3e50;
    line-height: 1.6;
    font-size: 14px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* 评论区域特殊样式 */
.comments textarea:focus,
.comments input:focus {
    outline: none !important;
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

/* 移除所有元素的默认outline */
*:focus {
    outline: none;
}

/* 为可访问性保留键盘导航的视觉指示 */
*:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.footer-content p {
    margin-bottom: 10px;
    font-size: 14px;
}

.footer-content a {
    color: #3498db;
    text-decoration: none;
}

.footer-content a:hover {
    color: #5dade2;
}

/* 回到顶部按钮 */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* 移动端菜单样式 */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    color: #2c3e50;
    background: #f8f9fa;
}

.mobile-menu {
    display: none;
    background: #fff;
    border-top: 1px solid #e1e8ed;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.active {
    display: block;
    max-height: 300px;
}

.mobile-menu .nav-menu {
    flex-direction: column;
    padding: 20px;
    gap: 15px;
}

.mobile-menu .nav-menu a {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu .nav-menu a:last-child {
    border-bottom: none;
}

/* 代码高亮样式 */
.code-wrapper {
    display: flex;
    background: #2c3e50;
    border-radius: 8px;
    overflow: hidden;
}

.line-numbers {
    background: #34495e;
    color: #95a5a6;
    padding: 20px 15px;
    font-size: 12px;
    line-height: 1.5;
    user-select: none;
    border-right: 1px solid #4a5f7a;
}

.code-content {
    flex: 1;
    padding: 20px;
    overflow-x: auto;
}

/* 图片懒加载样式 */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fade-in {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .post-detail-title {
        font-size: 24px;
    }
    
    .post-detail {
        padding: 20px;
    }
    
    .post-item {
        padding: 20px;
    }
    
    .widget {
        padding: 20px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .post-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .post-detail-title {
        font-size: 20px;
    }
    
    .post-title {
        font-size: 20px;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #95a5a6;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}